package book.ssl;

import java.io.FileInputStream;
import java.io.IOException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;

import javax.net.ssl.KeyManagerFactory;

public class KeyManagerFactoryTest {

	public static void main(String[] args) throws NoSuchAlgorithmException, UnrecoverableKeyException, KeyStoreException, CertificateException, IOException {
		
		KeyManagerFactory factory = KeyManagerFactory.getInstance("Sunx509");
		FileInputStream in = new FileInputStream("/Users/apple/Documents/demo.keystore");
		KeyStore store = KeyStore.getInstance("JKS");
		store.load(in, "123456".toCharArray());
		in.close();
		factory.init(store, "123456".toCharArray());
	}
}
